// import * as _ from 'lodash'
import * as types from './mutations-types'

export default {
  // deleteFavoriteList({ commit }, song) {
  //   commit(types.SET_FAVORITELIST, deleteFavoriteList(song))
  // }
  // routeToGoodsDetailAction ({ commit }, goods) {
  //   commit(types.SET_GOODS_DETAIL_ITEM, goods)
  //   commit(types.SET_TABS_STATE, false)
  //   commit(types.SET_SEARCH_TITLE, false)
  // },
  hiddenTabsAndSearchTitle ({ commit }) {
    commit(types.SET_TABS_STATE, false)
    commit(types.SET_SEARCH_TITLE, false)
  },
  showTabsAndSearchTitle ({ commit }) {
    commit(types.SET_TABS_STATE, true)
    commit(types.SET_SEARCH_TITLE, true)
  },
  pushToVisitedList ({ commit, state }, articleId) {
    let tmpList = state.visitedList.slice(0)
    if (tmpList && tmpList.indexOf(articleId) < 0) {
      tmpList.push(articleId)
      commit('SET_VISITED_LIST', tmpList)
    }
  },
  pushToEvaluated ({ commit, state }, articleId) {
    let tmpList = state.evaluatedList.slice(0)
    if (tmpList && tmpList.indexOf(articleId) < 0) {
      tmpList.push(articleId)
      commit('SET_EVALUATED_LIST', tmpList)
    }
  }
}
